<template>
  <component class="yk-icon" :is="icon"></component>
</template>

<script>
import { defineAsyncComponent } from '@vue/runtime-core'
export default {
  props: {
    type: String
  },
  setup(props){
    return {
      icon: defineAsyncComponent(() => import(`./${props.type}`))
    }
  }
}
</script>

<style lang="less">
.yk-icon{
  width: 1em;
  height: 1em;
}
</style>